package com.example.attempt.service.impl;

import com.example.attempt.entity.Post;
import com.example.attempt.mapper.PostMapper;
import com.example.attempt.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PostServiceImpl implements PostService {
    @Autowired
    PostMapper postMapper;

    @Override
    public List<Post> queryAll(){return postMapper.queryAll();}

    @Override
    public List<Post> queryBySid(String sid){return postMapper.queryBySid(sid);}

    @Override
    public List<Post> queryByTid(String tid){return postMapper.queryByTid(tid);}

    @Override
    public List<Post> queryByAid(String aid){return postMapper.queryByAid(aid);}

    @Override
    public List<Post> queryByCid(String cid){return postMapper.queryByCid(cid);}

    @Override
    public Post queryByPid(int pid){return postMapper.queryByPid(pid);}

    @Override
    public int addPost(Post post){
        postMapper.addPost(post);
        return 0;
    }

    @Override
    public int deletePost(int pid){
        postMapper.deletePost(pid);
        return 0;
    }
}


